home *** CD-ROM | disk | FTP | other *** search
/ Software Explosion / Software Explosion (Fore-Matt Home Computing)(1996).iso / games / workbench / lander_2 / source / rocketaudio.c < prev    next >
C/C++ Source or Header  |  1996-01-01  |  2KB  |  110 lines

  1. #include <exec/types.h>
  2. #include <exec/memory.h>
  3. #include <exec/interrupts.h>
  4. #include "sample.h"
  5. #include "sounds.h"
  6. #include "flame.h"
  7.  
  8. #define MAXSOUNDS 9
  9.  
  10. extern Sound eagle1sound, eagle2sound, lcrashsound, rcrashsound, saucersound,
  11.     lxthrustsound, rxthrustsound, lythrustsound, rythrustsound;
  12.  
  13. GLOBAL Sound *sounds[MAXSOUNDS] = {&eagle1sound, &eagle2sound, &lcrashsound,
  14.         &rcrashsound, &saucersound, &lxthrustsound, &rxthrustsound,
  15.         &lythrustsound, &rythrustsound};
  16.  
  17. GLOBAL int maxsounds = MAXSOUNDS;
  18.  
  19. extern int debug;
  20.  
  21. RocketAudioQuit()
  22. {
  23.     endaudio();
  24. }
  25.  
  26. RocketAudioInit()
  27. {
  28.     initaudio();
  29.     add_cleanup(RocketAudioQuit, "rocket audio");
  30. }
  31.  
  32. Eagle1Done()
  33. {
  34.     StopSound(&eagle1sound);
  35.     PlaySound(&eagle2sound);
  36. }
  37.  
  38. Eagle2Done()
  39. {
  40.     StopSound(&eagle2sound);
  41. }
  42.  
  43. LandedAudio()
  44. {
  45.     SaucerQuiet();
  46.     PlaySound(&eagle1sound);
  47.     /* WaitSound(&eagle1sound);
  48.     PlaySound(&eagle2sound);
  49.     WaitSound(&eagle2sound); */
  50. }
  51.  
  52. CrashAudio()
  53. {
  54.     ThrustQuiet(LEFTFLAME|RIGHTFLAME|MAINFLAME);
  55.     SaucerQuiet();
  56.     PlaySound(&lcrashsound);
  57.     PlaySound(&rcrashsound);
  58. }
  59.  
  60. CrashQuiet()
  61. {
  62.     WaitSound(&lcrashsound);
  63.     WaitSound(&rcrashsound);
  64. }
  65.  
  66. PlaySaucer()
  67. {
  68.     PlaySound(&saucersound);
  69. }
  70.  
  71. SaucerQuiet()
  72. {
  73.     StopSound(&saucersound);
  74. }
  75.  
  76. ThrustAudio(i)
  77. int i;
  78. {
  79.     switch (i)
  80.     {
  81.         case LEFTFLAME:
  82.             PlaySound(&lxthrustsound);
  83.             break;
  84.         case RIGHTFLAME:
  85.             PlaySound(&rxthrustsound);
  86.             break;
  87.         case MAINFLAME:
  88.             PlaySound(&lythrustsound);
  89.             PlaySound(&rythrustsound);
  90.             break;
  91.     }
  92. }
  93.  
  94. ThrustQuiet(i)
  95. int i;
  96. {
  97.     if (i & LEFTFLAME)
  98.             StopSound(&lxthrustsound);
  99.  
  100.     if (i & RIGHTFLAME)
  101.             StopSound(&rxthrustsound);
  102.  
  103.     if (i &  MAINFLAME)
  104.     {
  105.         StopSound(&lythrustsound);
  106.         StopSound(&rythrustsound);
  107.     }
  108. }
  109.  
  110.